/*
 * @Author: yaoling 1871883713@qq.com
 * @Date: 2022-10-20 18:11:21
 * @LastEditors: yaoling 1871883713@qq.com
 * @LastEditTime: 2022-12-06 14:56:09
 * @FilePath: \company-world\src\apis\jurisdiction\Role.ts
 * @Description: 角色管理接口
 */
import Request from '@/apis/index'
/**
 * @desc: 获取数据
 */
export function getRoleList(params?: object) {
    return Request.get({
        url: '/admin/role',
        method: 'GET',
        params: params
    })
}
/**
 * @desc: 删除
 */
export function deleteRoleData(id?: number) {
    return Request.delete({
        url: "/admin/role",
        method: "DELETE",
        params: { indexId: id },
    })
}
/**
 * @desc: 新增数据
 */
export function newRoleData(data: Object) {
    return Request.post({
        url: "/admin/role",
        method: "POST",
        data: data,
    })
}
/**
 * @desc: 批量增加用户菜单权限
 */
export function createPostReq(data: any) {
    return Request.post({
        url: "/admin/menu-role",
        method: "POST",
        data: data
    })
}


/**
 * @desc: 获取用户菜单权限
 */
export function getMenuRoleList(params?: object) {
    return Request.get({
        url: "/admin/menu-role",
        method: "GET",
        params: params
    })
}

/**
 * @desc: 批量删除用户菜单权限
 */
export function deleteMenuRoleData(data: any) {
    return Request.delete({
        url: "/admin/menu-role",
        method: "DELETE",
        data: data
    })
}

/**
 * @desc: 修改
 */
export function editRoleData(data: Object) {
    return Request.put({
        url: "/admin/role",
        method: "PUT",
        data: data,
    })
}
